
#ifndef DATATYPE_H
#define DATATYPE_H

#include<opencv2/opencv.hpp>

namespace hnurm
{
    //compulsory class enumerate
    enum class WorkMode: int 
    {
        manual=0, 
        auto_shoot=1, 
        auto_windmill=2, 
        auto_save=3, 
        auto_grab=4 
    };

    enum class SelfColor: int 
    { 
        none = 0B0000, 
        red=0B0101, 
        blue=0B1010 
    };

    enum class BulletSpeed: int 
    { 
        hero10 = 0, 
        hero16 = 1, 
        infantry15 = 2, 
        infantry18 = 3, 
        infantry30 = 4 
    };

    struct VisionSendData
    {
        //strut initiate function
        VisionSendData(){}
        VisionSendData(int cam_id_, float pitch_, float yaw_, float distance_):
            cam_id(cam_id_), pitch(pitch_), yaw(yaw_), distance(distance_){}

        int cam_id;     // formatted in flag_register, low 8 bits  ||camera id(for engine car,there are two cameras)
        float pitch;
        float yaw;      // formatted in float data
        float distance; // formatted in float data

        short time_stamp;
    };


    /* memory figure
    *
    * self_color | act_id
    *       work_mode
    *
    */
    struct VisionRecvData
    {
        VisionRecvData(){}
        VisionRecvData(SelfColor self_color_, int actuator_id_, WorkMode mode_,  BulletSpeed speed_):
            self_color(self_color_), actuator_id(actuator_id_), mode(mode_), speed(speed_){}

        SelfColor self_color; // formatted in flag_register, lower 4 bits of low 8 bits
        int actuator_id;       // formatted in flag_register, higher 4 bits of low 8 bits
        WorkMode mode;        // formatted in flag_register, lower 4 bits of high 8 bits
        BulletSpeed speed; // formatted in flag_register, higher 4 bits of high 8 bits

        short time_stamp;
    };


    struct ImgInfo
    {
        ImgInfo(){}
        //ImgInfo()

        cv::Mat frame;
        time_t create_time;
        int cam_id;
        long frame_count;
        short time_stamp;
    };

    struct IMUInfo
    {
        IMUInfo(){}

        /*
        pitch
        yaw
        row
        speed 3-axis

        */
    };
}

#endif // !DATATYPE_H
